﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Net;
using System.Collections;
using System.Xml;
using System.Linq;
//using System.Xml.Linq;

using CommonUtils;
using TDAL = EzDAL.Auto2;
using TDALUtils = EzDAL.Utils;
using TConst = TERP.Constants;
using TUtils = TERP.Utils;
using TError = TERP.Errors;

namespace TERP.BizITS
{
	public partial class BizWater
	{

		#region //Validate
		#region //Check Supplier code exist
		private void checkExistSupplierCode(
			ref ArrayList alParamsCoupleError
			, string strSupplierCode
			, string strIsActive
			, out DataTable dtSupplier
		 )
		{
			dtSupplier = TDALUtils.DBUtils.GetTableContents(
				_dbCarSv // db
				, "Water_Supplier" // strTableName
				, "top 1 *" // strColumnList
				, "" // strClauseOrderBy
				, "SupplierCode", "=", strSupplierCode // arrobjParamsTriple item
				, "IsActive", "=", strIsActive
			 );

			if (dtSupplier != null && dtSupplier.Rows.Count > 0)
			{

				throw CMyException.Raise(
					TError.ErrITS.Ser_Mst_Supplier_Exist
					, null
					, alParamsCoupleError.ToArray()
					);
			}
		}
		#endregion

		#region //Check Supplier exist
		private void checkExistSupplier(
			ref ArrayList alParamsCoupleError
			, string strSupplierID
			, out DataTable dtSupplier
		 )
		{
			dtSupplier = TDALUtils.DBUtils.GetTableContents(
				_dbCarSv // db
				, "Water_Supplier" // strTableName
				, "top 1 *" // strColumnList
				, "" // strClauseOrderBy
				, "SupplierID", "=", strSupplierID // arrobjParamsTriple item
			 );

			if (dtSupplier == null || dtSupplier.Rows.Count == 0)
			{

				throw CMyException.Raise(
					TError.ErrITS.Ser_Mst_Supplier_NotFound
					, null
					, alParamsCoupleError.ToArray()
					);
			}
		}
		#endregion

		#endregion

		#region // SerSupplierCreate
		public DataSet SerSupplierCreate(
			string strGwUserCode
			, string strGwPassword
			, string strTid
			, string strPartnerCode
			, string strPartnerUserCode
			, string strLanguageCode
			, string strSupplierCode
			, string strSupplierName
			, string strSupplierPhone
			, string strSupplierFax
			, string strContactName
			, string strContactPhone
			, string strAddress
			, string strIsActive
		)
		{
			#region // temp
			DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
			int nTidSeq = 0;
			bool bNeedTransaction = true;
			string strFunctionName = "SerSupplierCreate";
			string strErrorCodeDefault = TError.ErrITS.SerSupplierCreate;
			ArrayList alParamsCoupleError = new ArrayList(new object[]{
					"strFunctionName", strFunctionName
					, "strSupplierCode", strSupplierCode
					, "strSupplierName", strSupplierName				
                    , "strSupplierPhone", strSupplierPhone
                    , "strSupplierFax", strSupplierFax
                    , "strContactName", strContactName
                    , "strContactPhone", strContactPhone
                    , "strAddress", strAddress
                    , "strIsActive", strIsActive
					});
			#endregion

			try
			{
				#region // Init:
				_dbCarSv.AppUserID = strPartnerUserCode;
				if (bNeedTransaction) _dbCarSv.BeginTransaction();

				// Write request log:
				_log.WriteLogAsync(
					_strConfig_GwUserCode // strGwUserCodeForLog
					, _strConfig_GwUserPasswordForLog // strGwPasswordForLog
					, strTid // strAppTid
					, strPartnerCode // strAppServiceCode
					, strPartnerUserCode // strAppUserCode
					, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") // strAppTDateTime
					, TError.Error.NoError // strAppErrorCode
					, strFunctionName // strAppLogType1
					, "REQUEST" // strAppLogType2
					, "" // strAppLogType3
					, strLanguageCode // strAppLanguageCode
					, "" // strAppRemark
					, TUtils.CUtils.ParamsCouple2ParamsTriple(alParamsCoupleError, 1, "").ToArray() // arrobjParamsTriple
					);

				// Check Valid Tid:
				myUtils_ValidateId(
					ref alParamsCoupleError // alParamsCoupleError
					, strTid // strTid
					, TError.ErrHTC.CommonInvalidTid // strErrCodeWhenInvalid
					);
				#endregion

				#region //Check
				DataTable dtSupplier = null;
				this.checkExistSupplierCode(
					 ref alParamsCoupleError
					, strSupplierCode
					, strIsActive
					, out dtSupplier
				 );
			
				#endregion

				#region // Save data
				ArrayList alColumnEffective = new ArrayList();
				alColumnEffective.Clear();

				DataTable dt_Mst_Supplier = TDALUtils.DBUtils.GetSchema(_dbCarSv, "Water_Supplier").Tables[0];
				dt_Mst_Supplier.Rows.Add(dt_Mst_Supplier.NewRow());
				dt_Mst_Supplier.Rows[0]["SupplierCode"] = strSupplierCode.ToUpper();
				dt_Mst_Supplier.Rows[0]["SupplierName"] = strSupplierName;
				dt_Mst_Supplier.Rows[0]["Address"] = strAddress;
				dt_Mst_Supplier.Rows[0]["Phone"] = strSupplierPhone;
				dt_Mst_Supplier.Rows[0]["Fax"] = strSupplierFax;
				dt_Mst_Supplier.Rows[0]["ContactName"] = strContactName;
				dt_Mst_Supplier.Rows[0]["ContactPhone"] = strContactPhone;
				dt_Mst_Supplier.Rows[0]["IsActive"] = strIsActive;

				_dbCarSv.SaveData("Water_Supplier", dt_Mst_Supplier);
				string strSqlGetSupplierID = @"select @@Identity SupplierID;";
				Int32 iSupplierID = Convert.ToInt32(_dbCarSv.ExecQuery(strSqlGetSupplierID).Tables[0].Rows[0][0]);
				#endregion

				DataSet dsGetData = new DataSet();
				DataTable dtGetData = new DataTable("Ser_Mst_Supplier");
				dtGetData.Columns.Add(new DataColumn("SupplierID", typeof(System.Int32)));
				DataRow newRow = dtGetData.NewRow();
				newRow["SupplierID"] = iSupplierID;
				dtGetData.Rows.Add(newRow);
				dsGetData.Tables.Add(dtGetData);
				DataUtils.MoveDataTable(ref mdsFinal, ref dsGetData);

				// Return Good:
				TDALUtils.DBUtils.CommitSafety(_dbCarSv);
				mdsFinal.AcceptChanges();
				return mdsFinal;
			}
			catch (Exception exc)
			{
				#region // Catch of try:
				// Rollback:
				TDALUtils.DBUtils.RollbackSafety(_dbCarSv);

				// Return Bad:
				return TUtils.CProcessException.Process(
					ref mdsFinal
					, exc
					, strErrorCodeDefault
					, alParamsCoupleError.ToArray()
					);
				#endregion
			}
			finally
			{
				#region // Finally of try:
				// Rollback and Release resources:
				TDALUtils.DBUtils.RollbackSafety(_dbCarSv);
				TDALUtils.DBUtils.ReleaseAllSemaphore(_dbCarSv_Sys, true);

				TUtils.CProcessException.Process(
					ref mdsFinal // mdsFinal
					, _log // log
					, _strConfig_GwUserCode // strGwUserCodeForLog
					, _strConfig_GwUserPasswordForLog // strGwPasswordForLog
					, strFunctionName // strFunctionName
					, TUtils.CUtils.TidNext(strTid, ref nTidSeq) // strAppTid
					, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") // strAppTDateTime
					, strPartnerCode // strAppServiceCode
					, strPartnerUserCode // strAppUserCode
					, strLanguageCode // strLanguageCode
					, "" // strRemark
					);
				#endregion
			}
		}
		#endregion

		#region // SerSupplierUpdate
		public DataSet SerSupplierUpdate(
			string strGwUserCode
			, string strGwPassword
			, string strTid
			, string strPartnerCode
			, string strPartnerUserCode
			, string strLanguageCode
			, string strSupplierID
			, string strSupplierCode
			, string strSupplierName
			, string strSupplierPhone
			, string strSupplierFax
			, string strContactName
			, string strContactPhone
			, string strAddress
			, string strIsActive
		)
		{
			#region // temp
			DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
			int nTidSeq = 0;
			bool bNeedTransaction = true;
			string strFunctionName = "SerSupplierUpdate";
			string strErrorCodeDefault = TError.ErrITS.SerSupplierUpdate;
			ArrayList alParamsCoupleError = new ArrayList(new object[]{
					"strFunctionName", strFunctionName
                    , "strSupplierID", strSupplierID
					, "strSupplierCode", strSupplierCode
					, "strSupplierName", strSupplierName				
                    , "strSupplierPhone", strSupplierPhone
                    , "strSupplierFax", strSupplierFax
                    , "strContactName", strContactName
                    , "strContactPhone", strContactPhone
                    , "strAddress", strAddress
                    , "strIsActive", strIsActive
					});
			#endregion

			try
			{
				#region // Init:
				_dbCarSv.AppUserID = strPartnerUserCode;
				if (bNeedTransaction) _dbCarSv.BeginTransaction();

				// Write request log:
				_log.WriteLogAsync(
					_strConfig_GwUserCode // strGwUserCodeForLog
					, _strConfig_GwUserPasswordForLog // strGwPasswordForLog
					, strTid // strAppTid
					, strPartnerCode // strAppServiceCode
					, strPartnerUserCode // strAppUserCode
					, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") // strAppTDateTime
					, TError.Error.NoError // strAppErrorCode
					, strFunctionName // strAppLogType1
					, "REQUEST" // strAppLogType2
					, "" // strAppLogType3
					, strLanguageCode // strAppLanguageCode
					, "" // strAppRemark
					, TUtils.CUtils.ParamsCouple2ParamsTriple(alParamsCoupleError, 1, "").ToArray() // arrobjParamsTriple
					);

				// Check Valid Tid:
				myUtils_ValidateId(
					ref alParamsCoupleError // alParamsCoupleError
					, strTid // strTid
					, TError.ErrHTC.CommonInvalidTid // strErrCodeWhenInvalid
					);
				#endregion

				#region //Check
				DataTable dtSupplier = null;
				this.checkExistSupplier(
					 ref alParamsCoupleError
					, strSupplierID
					, out dtSupplier
				 );
			
				#endregion

				#region // Save data
				ArrayList alColumnEffective = new ArrayList();
				alColumnEffective.Clear();

				dtSupplier.Rows[0]["SupplierCode"] = strSupplierCode.ToUpper();
				dtSupplier.Rows[0]["SupplierName"] = strSupplierName;
				dtSupplier.Rows[0]["Address"] = strAddress;
				dtSupplier.Rows[0]["Phone"] = strSupplierPhone;
				dtSupplier.Rows[0]["Fax"] = strSupplierFax;
				dtSupplier.Rows[0]["ContactName"] = strContactName;
				dtSupplier.Rows[0]["ContactPhone"] = strContactPhone;
				dtSupplier.Rows[0]["IsActive"] = strIsActive;

				alColumnEffective.Add("SupplierCode");
				alColumnEffective.Add("SupplierName");
				alColumnEffective.Add("Phone");
				alColumnEffective.Add("Fax");
				alColumnEffective.Add("Address");
				alColumnEffective.Add("ContactName");
				alColumnEffective.Add("ContactPhone");
				alColumnEffective.Add("IsActive");

				_dbCarSv.SaveData("Water_Supplier", dtSupplier, alColumnEffective.ToArray());
				#endregion
				// Return Good:
				TDALUtils.DBUtils.CommitSafety(_dbCarSv);
				mdsFinal.AcceptChanges();
				return mdsFinal;
			}
			catch (Exception exc)
			{
				#region // Catch of try:
				// Rollback:
				TDALUtils.DBUtils.RollbackSafety(_dbCarSv);

				// Return Bad:
				return TUtils.CProcessException.Process(
					ref mdsFinal
					, exc
					, strErrorCodeDefault
					, alParamsCoupleError.ToArray()
					);
				#endregion
			}
			finally
			{
				#region // Finally of try:
				// Rollback and Release resources:
				TDALUtils.DBUtils.RollbackSafety(_dbCarSv);
				TDALUtils.DBUtils.ReleaseAllSemaphore(_dbCarSv_Sys, true);

				TUtils.CProcessException.Process(
					ref mdsFinal // mdsFinal
					, _log // log
					, _strConfig_GwUserCode // strGwUserCodeForLog
					, _strConfig_GwUserPasswordForLog // strGwPasswordForLog
					, strFunctionName // strFunctionName
					, TUtils.CUtils.TidNext(strTid, ref nTidSeq) // strAppTid
					, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") // strAppTDateTime
					, strPartnerCode // strAppServiceCode
					, strPartnerUserCode // strAppUserCode
					, strLanguageCode // strLanguageCode
					, "" // strRemark
					);
				#endregion
			}
		}
		#endregion

		#region // SerSupplierGet
		public DataSet SerSupplierGet(
			string strGwUserCode
			, string strGwPassword
			, string strTid
			, string strPartnerCode
			, string strPartnerUserCode
			, string strLanguageCode
			, string strSupplierIDConditionList
			, string strSupplierCodeConditionList
			, string strSupplierNameConditionList
			, string strAddressConditionList
			, string strIsActiveConditionList
		)
		{
			#region // temp
			DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
			int nTidSeq = 0;
			bool bNeedTransaction = true;
			string strFunctionName = "SerSupplierGet";
			string strErrorCodeDefault = TError.ErrITS.SerSupplierGet;
			ArrayList alParamsCoupleError = new ArrayList(new object[]{
					"strFunctionName", strFunctionName
                    , "strSupplierIDConditionList", strSupplierIDConditionList
					, "strSupplierCodeConditionList", strSupplierCodeConditionList
                    , "strSupplierNameConditionList", strSupplierNameConditionList
					, "strAddressConditionList", strAddressConditionList				
                    , "strIsActiveConditionList", strIsActiveConditionList
					});
			#endregion

			try
			{
				#region // Init:
				_dbCarSv.AppUserID = strPartnerUserCode;
				if (bNeedTransaction) _dbCarSv.BeginTransaction();

				// Write request log:
				_log.WriteLogAsync(
					_strConfig_GwUserCode // strGwUserCodeForLog
					, _strConfig_GwUserPasswordForLog // strGwPasswordForLog
					, strTid // strAppTid
					, strPartnerCode // strAppServiceCode
					, strPartnerUserCode // strAppUserCode
					, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") // strAppTDateTime
					, TError.Error.NoError // strAppErrorCode
					, strFunctionName // strAppLogType1
					, "REQUEST" // strAppLogType2
					, "" // strAppLogType3
					, strLanguageCode // strAppLanguageCode
					, "" // strAppRemark
					, TUtils.CUtils.ParamsCouple2ParamsTriple(alParamsCoupleError, 1, "").ToArray() // arrobjParamsTriple
					);

				// Check Valid Tid:
				myUtils_ValidateId(
					ref alParamsCoupleError // alParamsCoupleError
					, strTid // strTid
					, TError.ErrHTC.CommonInvalidTid // strErrCodeWhenInvalid
					);
				#endregion

				#region //Check

				#endregion


				#region // Build Sql:
				ArrayList alParamsCoupleSql = new ArrayList();
				//alParamsCoupleSql.AddRange(new object[] { "@strBUPatternOfUser", drAbilityOfUser["BUPattern"] });
				string strSqlGetData = StringUtils.Replace(@"
						-- #tbl_Ser_MST_Supplier:
						SELECT * 
                        FROM Water_Supplier sup
						WHERE (1=1)
							zzzzClauseWhere_strSupplierIDConditionList
                            zzzzClauseWhere_strSupplierCodeConditionList
                            zzzzClauseWhere_strSupplierNameConditionList
                            zzzzClauseWhere_strAddressConditionList
                            zzzzClauseWhere_strIsActiveConditionList
						;
					"
					);

				//// Ord_SalesOrder
				string zzzzClauseWhere_strSupplierIDConditionList = SqlUtils.BuildClause("and", "sup.SupplierID", strSupplierIDConditionList, "@p", ref alParamsCoupleSql);
				string zzzzClauseWhere_strSupplierCodeConditionList = SqlUtils.BuildClause("and", "sup.SupplierCode", strSupplierCodeConditionList, "@p", ref alParamsCoupleSql);
				string zzzzClauseWhere_strSupplierNameConditionList = SqlUtils.BuildClause("and", "sup.SupplierName", strSupplierNameConditionList, "@p", ref alParamsCoupleSql);
				string zzzzClauseWhere_strAddressConditionList = SqlUtils.BuildClause("and", "sup.Address", strAddressConditionList, "@p", ref alParamsCoupleSql);
				string zzzzClauseWhere_strIsActiveConditionList = SqlUtils.BuildClause("and", "sup.IsActive", strIsActiveConditionList, "@p", ref alParamsCoupleSql);

				strSqlGetData = StringUtils.Replace(
					strSqlGetData
					//// Ord_SalesOrder
					, "zzzzClauseWhere_strSupplierIDConditionList", zzzzClauseWhere_strSupplierIDConditionList
					, "zzzzClauseWhere_strSupplierCodeConditionList", zzzzClauseWhere_strSupplierCodeConditionList
					, "zzzzClauseWhere_strSupplierNameConditionList", zzzzClauseWhere_strSupplierNameConditionList
					, "zzzzClauseWhere_strAddressConditionList", zzzzClauseWhere_strAddressConditionList
					, "zzzzClauseWhere_strIsActiveConditionList", zzzzClauseWhere_strIsActiveConditionList
					);
				#endregion


				#region // Get Data:
				myDebug_SaveSql(
					_bDebugMode // bDebugMode
					, ref alParamsCoupleError // alParamsCoupleError
					, string.Format("strSql_{0}", strFunctionName) // strParamName
					, strSqlGetData // strSql
					);
				DataSet dsGetData = _dbCarSv.ExecQuery(
					strSqlGetData
					, alParamsCoupleSql.ToArray()
					);
				dsGetData.Tables[0].TableName = "Water_Supplier";
				DataUtils.MoveDataTable(ref mdsFinal, ref dsGetData);
				#endregion


				// Return Good:
				TDALUtils.DBUtils.CommitSafety(_dbCarSv);
				mdsFinal.AcceptChanges();
				return mdsFinal;
			}
			catch (Exception exc)
			{
				#region // Catch of try:
				// Rollback:
				TDALUtils.DBUtils.RollbackSafety(_dbCarSv);

				// Return Bad:
				return TUtils.CProcessException.Process(
					ref mdsFinal
					, exc
					, strErrorCodeDefault
					, alParamsCoupleError.ToArray()
					);
				#endregion
			}
			finally
			{
				#region // Finally of try:
				// Rollback and Release resources:
				TDALUtils.DBUtils.RollbackSafety(_dbCarSv);
				TDALUtils.DBUtils.ReleaseAllSemaphore(_dbCarSv_Sys, true);

				TUtils.CProcessException.Process(
					ref mdsFinal // mdsFinal
					, _log // log
					, _strConfig_GwUserCode // strGwUserCodeForLog
					, _strConfig_GwUserPasswordForLog // strGwPasswordForLog
					, strFunctionName // strFunctionName
					, TUtils.CUtils.TidNext(strTid, ref nTidSeq) // strAppTid
					, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") // strAppTDateTime
					, strPartnerCode // strAppServiceCode
					, strPartnerUserCode // strAppUserCode
					, strLanguageCode // strLanguageCode
					, "" // strRemark
					);
				#endregion
			}
		}
		#endregion

		#region // SerSupplierGetForCode
		public DataSet SerSupplierGetForCode(
			string strGwUserCode
			, string strGwPassword
			, string strTid
			, string strPartnerCode
			, string strPartnerUserCode
			, string strLanguageCode
			, string strIsActiveConditionList
		)
		{
			#region // temp
			DataSet mdsFinal = CMyDataSet.NewMyDataSet(strTid);
			int nTidSeq = 0;
			bool bNeedTransaction = true;
			string strFunctionName = "SerSupplierGetForCode";
			string strErrorCodeDefault = TError.ErrITS.SerSupplierGetForCode;
			ArrayList alParamsCoupleError = new ArrayList(new object[]{
					"strFunctionName", strFunctionName
                    , "strIsActiveConditionList", strIsActiveConditionList
					});
			#endregion

			try
			{
				#region // Init:
				_dbCarSv.AppUserID = strPartnerUserCode;
				if (bNeedTransaction) _dbCarSv.BeginTransaction();

				// Write request log:
				_log.WriteLogAsync(
					_strConfig_GwUserCode // strGwUserCodeForLog
					, _strConfig_GwUserPasswordForLog // strGwPasswordForLog
					, strTid // strAppTid
					, strPartnerCode // strAppServiceCode
					, strPartnerUserCode // strAppUserCode
					, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") // strAppTDateTime
					, TError.Error.NoError // strAppErrorCode
					, strFunctionName // strAppLogType1
					, "REQUEST" // strAppLogType2
					, "" // strAppLogType3
					, strLanguageCode // strAppLanguageCode
					, "" // strAppRemark
					, TUtils.CUtils.ParamsCouple2ParamsTriple(alParamsCoupleError, 1, "").ToArray() // arrobjParamsTriple
					);

				// Check Valid Tid:
				myUtils_ValidateId(
					ref alParamsCoupleError // alParamsCoupleError
					, strTid // strTid
					, TError.ErrHTC.CommonInvalidTid // strErrCodeWhenInvalid
					);
				#endregion

				#region //Check

				#endregion


				#region // Build Sql:
				ArrayList alParamsCoupleSql = new ArrayList();
				//alParamsCoupleSql.AddRange(new object[] { "@strBUPatternOfUser", drAbilityOfUser["BUPattern"] });
				string strSqlGetData = StringUtils.Replace(@"
						-- #tbl_Ser_MST_Supplier:
						SELECT sup.SupplierID
                                , sup.SupplierName
                                , sup.SupplierCode 
                        FROM Water_Supplier sup
						WHERE (1=1)
                            zzzzClauseWhere_strIsActiveConditionList
						;
					"
					);

				
				string zzzzClauseWhere_strIsActiveConditionList = SqlUtils.BuildClause("and", "sup.IsActive", strIsActiveConditionList, "@p", ref alParamsCoupleSql);

				strSqlGetData = StringUtils.Replace(
					strSqlGetData
					, "zzzzClauseWhere_strIsActiveConditionList", zzzzClauseWhere_strIsActiveConditionList
					);
				#endregion


				#region // Get Data:
				myDebug_SaveSql(
					_bDebugMode // bDebugMode
					, ref alParamsCoupleError // alParamsCoupleError
					, string.Format("strSql_{0}", strFunctionName) // strParamName
					, strSqlGetData // strSql
					);
				DataSet dsGetData = _dbCarSv.ExecQuery(
					strSqlGetData
					, alParamsCoupleSql.ToArray()
					);
				dsGetData.Tables[0].TableName = "Water_Supplier";
				DataUtils.MoveDataTable(ref mdsFinal, ref dsGetData);
				#endregion


				// Return Good:
				TDALUtils.DBUtils.CommitSafety(_dbCarSv);
				mdsFinal.AcceptChanges();
				return mdsFinal;
			}
			catch (Exception exc)
			{
				#region // Catch of try:
				// Rollback:
				TDALUtils.DBUtils.RollbackSafety(_dbCarSv);

				// Return Bad:
				return TUtils.CProcessException.Process(
					ref mdsFinal
					, exc
					, strErrorCodeDefault
					, alParamsCoupleError.ToArray()
					);
				#endregion
			}
			finally
			{
				#region // Finally of try:
				// Rollback and Release resources:
				TDALUtils.DBUtils.RollbackSafety(_dbCarSv);
				TDALUtils.DBUtils.ReleaseAllSemaphore(_dbCarSv_Sys, true);

				TUtils.CProcessException.Process(
					ref mdsFinal // mdsFinal
					, _log // log
					, _strConfig_GwUserCode // strGwUserCodeForLog
					, _strConfig_GwUserPasswordForLog // strGwPasswordForLog
					, strFunctionName // strFunctionName
					, TUtils.CUtils.TidNext(strTid, ref nTidSeq) // strAppTid
					, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") // strAppTDateTime
					, strPartnerCode // strAppServiceCode
					, strPartnerUserCode // strAppUserCode
					, strLanguageCode // strLanguageCode
					, "" // strRemark
					);
				#endregion
			}
		}
		#endregion

		
	}
}
